﻿#include <iostream>
using namespace std;
int main()
{
	int num[] = { 3,5,6,14,27,89,5,77,11 };
	//使用sizeof(num)整个数组占用空间内存的大小 / 数组的类型占用空间的内存大小 = 数组的长度
	for (int i = 0; i < sizeof(num) / sizeof(int); i++)
	{
		cout << "num[" << i << "]=" << num[i] << endl;
	}
	//menset可以将数组中的元素全部清零
	//memset(num, 0, sizeof(num));
	//memcpy拷贝数组
	int num1[sizeof(num) / sizeof(int)];
	memcpy(num1, num, sizeof(num));
	for (int i = 0; i < sizeof(num1) / sizeof(int); i++)
	{
		cout << "num1[" << i << "]=" << num1[i] << endl;
	}
}

